Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dl/feat/mouse scrolling in generic spinctrl #1

Open
wants to merge 184 commits into
base: master
Choose a base branch
from

Conversation

mxdamien
Copy link
Owner

Action runner

vadz and others added 30 commits October 7, 2024 15:52
It wasn't really used anywhere, but still appeared in the samples.
These functions don't do anything anyhow.
Use wxDisplay to get the main display DPI instead.
No actual changes to the test, a slight change of tone with one colour
scheme in the propgrid sample.
The code in wxGtkPrinter tried to determine whether all pages should be
printed from the values returned by GetPageInfo(), but this doesn't make
much sense because a typical implementation of GetPageInfo() uses the
values in the associated wxPrintDialogData to determine the pages to
return, i.e. it's wxPrintDialogData which is the primary source of truth
and the values set in it should be respected, otherwise we ended up with
"All pages" being selected in the print dialog independently of the
values set in the application code.

Just remove this code, which isn't present in the other ports neither,
to fix this.

Closes wxWidgets#24868.
Assert if an invalid item is passed to Select(), Unselect() or
IsSelected() instead of crashing.

Closes wxWidgets#24861.
…ries a wxMenuItem object, use the menu item's help text directly without looking up the item via its ID
…g through all menu entries in the MSW menu handle and pass the found wxMenuItem to the wxMenuEvent. This gives the wxMenuEvent access to all information stored in the wxMenuItem and not just its ID
HTTP headers like Set-Cookie can be present multiple times in a
web response by definition. The existing GetHeader() method is
not sufficient to cope with this situation.

This commit already adds an implementation for Windows.
Linux and macOS follow in the next commits.
wxWebRequest::AddHeader() was added to accompany the existing
SetHeader() method. In wxWebSession, AddCommonHeader() did exist
already but behaved like setting a header. Its behavior was adapted
to its name and SetCommonHeader() was added with the old behavior
to accompany AddCommonHeader().

The WinHTTP and CURL implementations of wxWebRequest do now append
multiple headers of the same name. The URLSession implementation
follows in the next commits.
Don't use CGDisplayCreateImage() which is not available in macOS 15 any
more.

Closes wxWidgets#24724.

Closes wxWidgets#24879.
Try to make it as clear as possible that this class shouldn't be used
any longer without formally deprecating it (as it does still work in
wxMSW and, also, is still used in some of our own code).
Deprecate wxScreenDC even more, without formally deprecating it.

See wxWidgets#24864.
…/mxdamien/wxWidgets

Show help text in status bar when mouse is above submenu-entry in wxMSW.

See wxWidgets#24874.

Closes wxWidgets#24842.
This was done in the sample bakefile, apparently unnecessarily, but not
in CMakeLists.txt, so add the library there too now that it will be
really needed because the sample will use wxXmlDocument after the next
commit.
The contents of a webrequest header can be checked with the
headers endpoint of the httpbin service.
Multiple HTTP headers with the same name are not supported by the
URLsession API. As a fallback, the last header is used instead.
The two strings that are compared should now be printed on
test failure.
Some code duplication can be removed by using
wxWinHTTPQueryAllHeaderStrings() in wxWinHTTPQueryHeaderString()
and returning ony the last queried header. This change also
increases consistency accross all webrequest implementations to
prefer the last header over the first in ambiguities.
vadz and others added 30 commits October 31, 2024 17:19
…in wxGTK."

This reverts 42fdb98 (Don't prevent the other button release handlers
from running in wxGTK., 2014-09-27) because it doesn't seem necessary
any more: the original test case from wxWidgets#16055 which this commit was done
to fix works after reverting it and the modified test case from the same
issue doesn't crash any more neither. And, finally, wxTR_EDIT_LABELS
still works too (see wxWidgets#16573).

So follow the usual rule and do stop GTK signal handling if the event
was processed.
Get rid of an ugly macro and also simplify things: we don't need
per-function static "eventPrev", as GTK event propagation never
interleaves the events of different types, so we can just have a single
global storing the last event for checking if we had already seen it or
not.
This commit fixes a long-standing problem with receiving "phantom"
events after dismissing a modal dialog shown from an event handler which
can be illustrated using the following example:

--------------------------------- >8 --------------------------------------
#include <wx/app.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/frame.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/stattext.h>

class TestApp : public wxApp {
public:
    bool OnInit() override {
        auto f = new wxFrame(nullptr, wxID_ANY, "wx Test");
        auto b = new wxButton(f, wxID_ANY, "Dialog");
        b->Bind(wxEVT_BUTTON, [f](wxCommandEvent&) {
            wxDialog dlg(f, wxID_ANY, "Dialog");
            dlg.SetSizerAndFit(dlg.CreateStdDialogButtonSizer(wxOK));
            dlg.ShowModal();
        });

        f->Bind(wxEVT_LEFT_UP, [f](wxMouseEvent&) {
            wxMessageBox("Got left up", "wx Test", wxOK | wxICON_INFORMATION, f);
        });

        auto* const sizer = new wxGridSizer(1);
        sizer->Add(b, wxSizerFlags().Center());
        f->SetSizer(sizer);

        f->Show();
        return true;
    }
};

wxIMPLEMENT_APP(TestApp);
--------------------------------- >8 --------------------------------------

Showing the dialog by clicking the button and then dismissing it by
clicking the button in the dialog resulted in the message box coming up.

This was due to the fact that the existing code preventing GTK from
propagating key and mouse events upwards the window parent chain based
on using the global gs_lastEvent variable didn't work if an event
handler dispatched any events from inside it, e.g. by showing a modal
dialog which ran its own nested event loop: the global variable was
overwritten by the event handling in it and, after dismissing the dialog
and returning to GTK, our handler was called again for the parent window
with the same event that we had already seen, but we didn't ignore it
any more because gs_lastEvent had been changed in the meanwhile.

Fix this by replacing the global variable with a wxEventLoop member
variable and using the currently active wxEventLoop for storing the
"last event", as it ensures that the original event is not overwritten
by event dispatching in the nested event loop.

Note that it would be tempting to achieve the same effect in a much
simpler way by connecting "after" signal handlers for all the signals
that we want to prevent from bubbling up without affecting their default
handling and this actually works fine for all of them -- except the "key
press" one, as it needs to reach the TLW parent in order to trigger the
calls to gtk_window_propagate_key_event() and gtk_window_activate_key()
there and it seems tricky to call these functions manually without
running into infinite recursion. It would be nice if we could do this,
as this would also make using our custom event source (see commit
d0406f4 (Fix handling of identical consecutive key events,
2014-08-15) and wxWidgets#15802) unnecessary, but for now use this less intrusive
fix.
No real changes, just make the trace messages more understandable.
Send events about entering/leaving windows such as wxStaticText, which
don't have their own window at GTK level, and so don't get the
corresponding signals from GTK -- but we can still synthesize these
events if we detect mouse motion in another window.

This commit is best viewed with Git --color-moved option.

Closes wxWidgets#11848.
First of all, ensure that the press and release events do go to the
window with the capture, which may not have been the case at all when
the capturing window didn't have a corresponding GDK window, e.g. when
capturing mouse in wxStaticText-derived class.

And also adjust the coordinates to be correct for the captured window to
ensure that the window receives the expected events.
The call to wxGetTranslation() was ambiguous. Fix this by adding missing
wxASCII_STR() for all string literal arguments in wxGETTEXT_IN_CONTEXT
and wxGETTEXT_IN_CONTEXT_PLURAL, just as it is used in _().

Also test that all translation macros expand to compilable code
when wxNO_IMPLICIT_WXSTRING_ENCODING is enabled.

See wxWidgets#1312 and also wxWidgets#24916.

Closes wxWidgets#24925.
Because we don't have the correct client size when the window is
minimized (at least in wxMSW), postpone the actual update until the
window is restored, as we don't really need to do it until then anyhow.

Closes wxWidgets#24930.
Returning negative size, due to subtracting tool/status bar size from
it, was unexpected, so return empty, i.e. (0,0), size when the window is
iconized instead, as documented.
Zero out m_lastEvent originally to avoid reading uninitialized memory
contents later in memcmp() when GTKIsSameAsLastEvent() is copied.
Fix handling client area offset in wxMSW for different DC classes.

See wxWidgets#24924.
wxAUI notebook pages dragging-related fixes, fixing wxWidgets#24890 and wxWidgets#24892.

See wxWidgets#24911.
Fix crash in wxWebRequestCURL when connection is refused

See wxWidgets#24914.
Fixes for owner drawn wxListBox items background.

See wxWidgets#24918.
Miscellaneous wxPropertyGrid fixes.

See wxWidgets#24929.
Make default titles translatable, don't piece strings together for
title.

Also, make initial frame size DPI aware.

Remove wxT macros.

Closes wxWidgets#24916.
…-leave-events'

Fix multiple problems with GTK mouse events:

- Avoid phantom release events after dismissing modal dialog (wxWidgets#24931).
- Do send enter/leave events for window-less controls in wxGTK (wxWidgets#24932).
- Fix coordinates in click events sent to window with capture (wxWidgets#24933).
Fix updating AUI while minimized.

See wxWidgets#24934.
No real changes, just remove an accidentally added U+200B from one
translation.
Fix the change done in f89cbe6 (wxQt: translate QPainter of
wxClientDC into window client area., 2024-10-28) to set up clipping
correctly.

See wxWidgets#24921.
…Widgets#24939)

Based on the behavior of WIN32 LoadFile(), and the gdk-pixbuf BMP loader source
code, the alpha values are ignored unless the compression method is BI_BITFIELDS.
See wxWidgets#10915, wxWidgets#24219
Add another insignificant commit to the list of commits to ignore.
Changes of 4f9186f (Increase usable scrolling range in wxMSW by a
factor of 10,000, 2022-04-30) broke device origin handling if axis had
non-default direction because we didn't account for their signs at all.

Just do it now by interpreting the origin correctly depending on
direction.

See wxWidgets#24938.

Closes wxWidgets#24198.
In particular, mention that it doesn't make sense to express it in
dialog units and that this is not supported.

See wxWidgets#24698, wxWidgets#24840.
The purpose of WXINTL_NO_GETTEXT_MACRO is, as I understand it, to avoid
name clashes between _() and symbols with the same name introduced by
other libraries or compilers.

Although wxPLURAL has forever (15d0695 (added wxPLURAL() macro,
2005-06-01)) been conditionally defined, there is no similar need with it.
wxPLURAL has a longer name, and is wx-prefixed. The other, more recently
introduced translation macros are not conditionally defined, which makes
wxPLURAL inconsistent in this regard.

Closes wxWidgets#24943.
The compilation fix in PR wxWidgets#24925, a47b560 (Fix
wxGETTEXT_IN_CONTEXT* with wxNO_IMPLICIT_WXSTRING_ENCODING,
2024-10-29) aimed for the wxNO_IMPLICIT_WXSTRING_ENCODING
case presumably also has the side effect of preventing
non-ASCII (non-English) msgids with wxGETTEXT_IN_CONTEXT_PLURAL,
also in the regular case when implicit encoding is permitted.

It is best to define wxGETTEXT_IN_CONTEXT_PLURAL separately for
both wxNO_IMPLICIT_WXSTRING_ENCODING and without it, similarly
to how wxGETTEXT_IN_CONTEXT is defined. For some reason it
was defined only once until now.

This commit reverts the definition of
wxGETTEXT_IN_CONTEXT_PLURAL for the regular case to what it
was before.

Closes wxWidgets#24944.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.